using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

// [CustomEditor(typeof(EnemyGenerator))]
public class TestEditor : Editor
{
    private bool showGenAction=true;
    private bool showConfigArray = true;
    public override void OnInspectorGUI()
    {
        Debug.Log(this.target.GetType());
        

        EnemyGenerator generator = (EnemyGenerator)target;
        // generator.enemyPrefab=(GameObject)EditorGUILayout.ObjectField("敌人预制件",generator.enemyPrefab,typeof(GameObject),false);
        generator.genTimes=EditorGUILayout.IntField("生成敌人次数",generator.genTimes);

        showGenAction=EditorGUILayout.Foldout(showGenAction,"Gen Action");
        if(showGenAction){
            EditorGUI.indentLevel++;
            SeqAction genAction = generator.genAction;
            genAction.beginWaitTime = EditorGUILayout.FloatField("Begin Wait Time",genAction.beginWaitTime);
            genAction.intervalTime = EditorGUILayout.FloatField("Interval Time", genAction.intervalTime);
            genAction.keepingTime = EditorGUILayout.FloatField("Keeping Time", genAction.keepingTime);
            EditorGUI.indentLevel--;
        }

        showConfigArray=EditorGUILayout.Foldout(showConfigArray,"敌人配置");

        // EnemyGenerator.Config[] configs=generator.configs;
        base.DrawDefaultInspector();
        base.OnInspectorGUI();
    }

}
